﻿using Microsoft.AspNetCore.Mvc;
using MyFramework.Core.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebApi.Models;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace MyFramework.Plugins.Core.Controllers
{
    /// <summary>
    /// 测试
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class OpenApiController : ControllerBase
    {
        /// <summary>
        /// 测试
        /// </summary>
        /// <remarks>
        /// 请求示例
        ///  
        ///     {
        ///       "processName": "string",
        ///       "formCode": "string",
        ///       "loginUserAccount": "string",
        ///       "userAccount": "string",
        ///       "taskID": "string",
        ///       "nonCustomForm": {
        ///         "mainCommon": {
        ///           "signTheAttachment": "string",
        ///           "requestUserAccount": "string",
        ///           "requestUser": "string",
        ///           "requestMemberFullName": "string",
        ///           "requestDeptCode": "string",
        ///           "requestDept": "string",
        ///           "requsetPosition": "string",
        ///           "requsetSuperiorAccount": "string",
        ///           "requsetSuperior": "string",
        ///           "requestDate": "2021-03-12T01:46:22.034Z",
        ///           "processName": "string",
        ///           "formCode": "string",
        ///           "isRegular": true,
        ///           "businessTypeCode": "string",
        ///           "isOutBudget": true,
        ///           "applyAmount": 0,
        ///           "companyCode": "string",
        ///           "projectCode": "string",
        ///           "isAEI": true,
        ///           "isCEOApprove": true,
        ///           "isPhoneFeeOut": true,
        ///           "contractSignNames": [
        ///             "string"
        ///           ],
        ///           "payer": "string",
        ///           "payerIsNeedSeal": true,
        ///           "isStandardContract": true,
        ///           "projectLeader": [
        ///             "string"
        ///           ],
        ///           "legalLeader": [
        ///             "string"
        ///           ],
        ///           "isNeedAD": true,
        ///           "perServe": 0,
        ///           "isSeniorManagerApprove": true,
        ///           "reimburseCode": 0,
        ///           "formType": 0,
        ///           "isException": 0,
        ///           "maxPerServe": 0,
        ///           "budgetCenterNames": "string",
        ///           "budgetItemCodes": "string",
        ///           "dynamicForm": "string"
        ///         },
        ///         "budgetItems": [
        ///           {
        ///             "budgetItemCode": "string",
        ///             "budgetAmount": "string"
        ///           }
        ///         ]
        ///       }
        ///     }
        /// </remarks>
        /// <param name="data"></param>
        [HttpPost]
        public ApiResponse Post(FKRequertParams data)
        {
            ApiResponse apiResponse = new ApiResponse();
            try
            {

            }
            catch (Exception ex)
            {
                apiResponse.Code = 500;
                apiResponse.Msg = ex.Message;
            }
            return apiResponse;
        }
    }
}
